home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / mac / files / t_sys5 / unixcpio.gz / unixnet.cpio / ax25.h < prev    next >
C/C++ Source or Header  |  1994-07-11  |  2KB  |  52 lines

  1. /* AX.25 datagram (address) sub-layer definitions */
  2.  
  3. /* Maximum number of digipeaters */
  4. #define    MAXDIGIS    7    /* 7 digipeaters plus src/dest */
  5. #define    ALEN        6    /* Number of chars in callsign field */
  6. #define    AXALEN        7    /* Total AX.25 address length, including SSID */
  7.  
  8. /* Internal representation of an AX.25 address */
  9. struct ax25_addr {
  10.     char call[ALEN];    
  11.     char ssid;
  12. #define    SSID        0x1e    /* Sub station ID */
  13. #define    REPEATED    0x80    /* Has-been-repeated bit in repeater field */
  14. #define    E        0x01    /* Address extension bit */
  15. #define    C        0x80    /* Command/response designation */
  16. };
  17. #define    NULLAXADDR    (struct ax25_addr *)0
  18. /* Our AX.25 address */
  19. extern struct ax25_addr mycall;
  20.  
  21. /* AX.25 broadcast address: "QST   -0" in shifted ASCII */
  22. extern struct ax25_addr ax25_bdcst;
  23.  
  24. /* Internal representation of an AX.25 header */
  25. struct ax25 {
  26.     struct ax25_addr dest;            /* Destination address */
  27.     struct ax25_addr source;        /* Source address */
  28.     struct ax25_addr digis[MAXDIGIS];    /* Digi string */
  29.     int ndigis;                /* Number of digipeaters */
  30.     int cmdrsp;                /* Command/response */
  31. };
  32.  
  33. /* C-bit stuff */
  34. #define    UNKNOWN        0
  35. #define    COMMAND        1
  36. #define    RESPONSE    2
  37.  
  38. /* Bit fields in AX.25 Level 3 Protocol IDs (PIDs)
  39.  * The high order two bits control multi-frame messages.
  40.  * The lower 6 bits is the actual PID. Single-frame messages are
  41.  * sent with both the FIRST and LAST bits set, so that the resulting PIDs
  42.  * are compatible with older code.
  43.  */
  44. #define    PID_FIRST    0x80    /* Frame is first in a message */
  45. #define    PID_LAST    0x40    /* Frame is last in a message */
  46. #define    PID_PID        0x3f    /* Protocol ID subfield */
  47.  
  48. #define    PID_IP        0x0c    /* ARPA Internet Protocol */
  49. #define    PID_ARP        0x0d    /* ARPA Address Resolution Protocol */
  50. #define    PID_NETROM    0x0f    /* NET/ROM */
  51. #define    PID_NO_L3    0x30    /* No level 3 protocol */
  52.